from selenium import webdriver
import time

# 打开浏览器
driver = webdriver.Chrome()
time.sleep(1)
# 百度
driver.get('https://www.baidu.com')


# 输入天气预报
driver.find_element_by_id('kw').send_keys('天气预报')
time.sleep(1)

driver.find_element_by_id('su').click()
time.sleep(1)

print(driver.title)

print(('天气' in driver.title))


# 关闭
driver.quit()